package com.tsing.cedap.common.exceptions;

/**
 * 业务异常,所有与具体业务有关的异常统一抛本类或其子类,使用ExceptionType来确定异常代码,提示信息
 */
public class BusinessException extends RuntimeException {

    private int code;

    private String description;

    public BusinessException() {
        super();
    }

    public BusinessException(ExceptionType type) {
        super(type.getDescription());
        this.code = type.getCode();
        this.description = type.getDescription();
    }

    public BusinessException(ExceptionType type, Throwable cause) {
        super(type.getDescription(), cause);
        this.code = type.getCode();
        this.description = type.getDescription();
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

}
